home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Internet / WWW / Perl_WWW_Utilities / txt2html / sample-dict < prev    next >
Encoding:
Text File  |  1996-02-06  |  3.6 KB  |  108 lines

  1. #
  2. # Sample links dictionary file for Seth Golub's txt2html v1.11
  3. # http://www.cs.wustl.edu/~seth/txt2html/
  4. #
  5. # $Revision: $
  6. # This dictionary contains some patterns for converting obvious URLs,
  7. # ftp sites, hostnames, email addresses and the like to hrefs.
  8. #
  9. # Adapted shamelessly from the html.pl package by Oscar Nierstrasz in
  10. # the Software Archive of the Software Composition Group
  11. # http://iamwww.unibe.ch/~scg/Src/
  12. #
  13. # Email suggestions to seth@cs.wustl.edu
  14. # Please include "txt2html" in the subject of your message.
  15. #
  16.  
  17. # Urls: <serice>:<rest-of-url>
  18.  
  19. |snews:[\w\.]+|         -> $&
  20. |http:[\w/\.:+\-~\%#?]+|  -> $&
  21. |shttp:[\w/\.:+\-~\%#?]+| -> $&
  22. |https:[\w/\.:+\-~\%#?]+| -> $&
  23. |file:[\w/\.:+\-]+|     -> $&
  24. |ftp:[\w/\.:+\-]+|      -> $&
  25. |wais:[\w/\.:+\-]+|     -> $&
  26. |gopher:[\w/\.:+\-]+|   -> $&
  27. |telnet:[\w/\.:+\-]+|   -> $&
  28.  
  29.  
  30. # catch some newsgroups to avoid confusion with sites:
  31. |([^\w\-/\.:\@>])(alt\.[\w\.+\-]+[\w+\-]+)|    -h-> $1<a href="news:$2">$2</a>
  32. |([^\w\-/\.:\@>])(bionet\.[\w\.+\-]+[\w+\-]+)| -h-> $1<a href="news:$2">$2</a>
  33. |([^\w\-/\.:\@>])(bit\.[\w\.+\-]+[\w+\-]+)|    -h-> $1<a href="news:$2">$2</a>
  34. |([^\w\-/\.:\@>])(comp\.[\w\.+\-]+[\w+\-]+)|   -h-> $1<a href="news:$2">$2</a>
  35. |([^\w\-/\.:\@>])(gnu\.[\w\.+\-]+[\w+\-]+)|    -h-> $1<a href="news:$2">$2</a>
  36. |([^\w\-/\.:\@>])(misc\.[\w\.+\-]+[\w+\-]+)|   -h-> $1<a href="news:$2">$2</a>
  37. |([^\w\-/\.:\@>])(news\.[\w\.+\-]+[\w+\-]+)|   -h-> $1<a href="news:$2">$2</a>
  38. |([^\w\-/\.:\@>])(rec\.[\w\.+\-]+[\w+\-]+)|    -h-> $1<a href="news:$2">$2</a>
  39. |([^\w\-/\.:\@>])(soc\.[\w\.+\-]+[\w+\-]+)|    -h-> $1<a href="news:$2">$2</a>
  40. |([^\w\-/\.:\@>])(talk\.[\w\.+\-]+[\w+\-]+)|   -h-> $1<a href="news:$2">$2</a>
  41. |([^\w\-/\.:\@>])(ch\.[\w\.+\-]+[\w+\-]+)|     -h-> $1<a href="news:$2">$2</a>
  42.  
  43. # FTP locations (with directory):
  44. # anonymous@<site>:<path>
  45. |(anonymous\@)([a-zA-Z][\w\.+\-]+\.[a-zA-Z]{2,}):(\s*)([\w\d+\-/\.]+)|
  46.   -h-> $1<a href="ftp://$2/$4">$2:$4</a>$3
  47.  
  48. # ftp@<site>:<path>
  49. |(ftp\@)([a-zA-Z][\w\.+\-]+\.[a-zA-Z]{2,}):(\s*)([\w\d+\-/\.]+)|
  50.   -h-> $1<a href="ftp://$2/$4">$2:$4</a>$3
  51.  
  52. # Email address
  53. |[a-zA-Z0-9_\+\-\.]+\@([a-zA-Z][\w\.+\-]+\.[a-zA-Z]{2,})|
  54.   -> mailto:$&
  55.  
  56. # <site>:<path>
  57. |([^\w\-/\.:\@>])([a-zA-Z][\w\.+\-]+\.[a-zA-Z]{2,}):(\s*)([\w\d+\-/\.]+)|
  58.   -h-> $1<a href="ftp://$2/$4">$2:$4</a>$3
  59.  
  60. # NB: don't confuse an http server with a port number for
  61. # an FTP location!
  62. # internet number version: <internet-num>:<path>
  63. |([^\w\-/\.:\@])(\d{2,}\.\d{2,}\.\d+\.\d+):([\w\d+\-/\.]+)|
  64.   -h-> $1<a href="ftp://$2/$3">$2:$3</a>
  65.  
  66. # telnet <site> <port>
  67. |telnet ([a-zA-Z][\w+\-]+(\.[\w\.+\-]+)+\.[a-zA-Z]{2,})\s+(\d{2,4})|
  68.   -h-> telnet <a href="telnet://$1:$3/">$1 $3</a>
  69.  
  70. # ftp <site>
  71. |ftp ([a-zA-Z][\w+\-]+(\.[\w\.+\-]+)+\.[a-zA-Z]{2,})|
  72.   -h-> ftp <a href="ftp://$1/">$1</a>
  73.  
  74. # host with "ftp" in the machine name
  75. |([a-zA-Z][\w+\-]*ftp[a-zA-Z][\w+\-]*\.[\w\.+\-]+\.[a-zA-Z]{2,})([^\w\d\-/\.:!])|
  76.   -h-> ftp <a href="ftp://$1/">$1</a>$2
  77.  
  78. # <site> <port>
  79. |([a-zA-Z][\w+\-]+\.[\w+\-]+\.[a-zA-Z]{2,})\s+(\d{2,4})|
  80.   -h-> <a href="telnet://$1:$2/">$1 $2</a>
  81.  
  82. # just the site name: <site>
  83. |([^\w\-/\.:\@>])([a-zA-Z][\w+\-]+(\.[\w+\-]+)+\.[a-zA-Z]{2,})|
  84.   -h-> $1<a href="telnet://$2">$2</a>
  85.  
  86. # just internet numbers with port:
  87. |([^\w\-/\.:\@])(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\s+(\d{1,4})|
  88.   -h-> $1<a href="telnet://$2:$3">$2 $3</a>
  89.  
  90. # just internet numbers:
  91. |([^\w\-/\.:\@])(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})|
  92.   -h-> $1<a href="telnet://$2">$2</a>
  93.  
  94.  
  95. # RFCs
  96. /RFC ?(\d+)/ -i-> http://www.cis.ohio-state.edu:82/rfc/rfc$1.html
  97.  
  98.  
  99. # Seth and his amazing conversion program    :-)
  100.  
  101. "Seth Golub"  -i-> http://www.cs.wustl.edu/~seth/
  102. "txt2html"    -i-> http://www.cs.wustl.edu/~seth/txt2html/
  103.  
  104.  
  105. # End of sample dictionary
  106.  
  107.